package com.bdqn.service.impl;

import com.bdqn.mapper.AppInfoMapper;
import com.bdqn.pojo.AppInfo;
import com.bdqn.pojo.Cha;
import com.bdqn.service.AppInfoService;
import com.bdqn.util.LayData;
import org.apache.ibatis.annotations.Lang;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("appInfoService")
public class AppInfoServiceImpl implements AppInfoService {
    @Resource
    private AppInfoMapper appInfoMapper;



    @Override
  public  Long count(String name){
        return null;
    }

    @Override
    public Long addAppinfo(AppInfo appInfo) {
        return appInfoMapper.addAppinfo(appInfo);
    }

    @Override
    public AppInfo getOne(Long id) {
        return appInfoMapper.getOne(id);
    }

    @Override
    public Long upd(AppInfo appInfo) {
        return appInfoMapper.upd(appInfo);
    }

    @Override
    public Long updZhuang(Long zhuang, Integer id) {
        return appInfoMapper.updZhuang(zhuang,id);
    }

    @Override
    public Long deleteOne(Integer id) {
        return appInfoMapper.deleteOne(id);
    }

    @Override
    public LayData getAll(String name, Long zhuang, Long ping, Long one, Long two, Long three, Long currentPage, Long pageSize) {
        return LayData.data(appInfoMapper.count(name, zhuang, ping, one, two, three),appInfoMapper.getAll(name,zhuang,ping,one,two,three,(currentPage-1)*pageSize,pageSize));

    }
}
